-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Online DDL: detect vreplication
errors via vreplication_log
history
#16925
Online DDL: detect vreplication
errors via vreplication_log
history
#16925
Conversation
Signed-off-by: Shlomi Noach <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Signed-off-by: Shlomi Noach <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16925 +/- ##
==========================================
- Coverage 69.40% 67.15% -2.26%
==========================================
Files 1570 1571 +1
Lines 203846 251782 +47936
==========================================
+ Hits 141488 169082 +27594
- Misses 62358 82700 +20342 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! It's nice to see the _vt.vreplication_log
table being put to good use ❤️
@@ -305,7 +305,7 @@ func (ct *controller) runBlp(ctx context.Context) (err error) { | |||
if (err != nil && vr.WorkflowSubType == int32(binlogdatapb.VReplicationWorkflowSubType_AtomicCopy)) || | |||
isUnrecoverableError(err) || | |||
!ct.lastWorkflowError.ShouldRetry() { | |||
|
|||
err = vterrors.Wrapf(err, "terminal error") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth making terminal error
an exported const IMO. Then that can be used in the query as well: OR locate ('terminal error:', message) = 1
and in the unit test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've parameterized the string, using the parameter in creation and in SQL. However, in unit tests I'm still using the hard coded text because I think it makes the unit test clearer.
Signed-off-by: Shlomi Noach <[email protected]>
Related: #17264 |
Description
Today,
vreplication
based Online DDL reads_vt.vreplication
table, and usesstate
andmessage
columns as indicators to errors.However, these columns, even if there's a terminal error, can be overwritten and shadowed by later changes to
vreplication
state, as described in #16924.Thankfully,
_vt.vreplication_log
persists all states and messages throughout the workflow's lifetime. In this PR, Online DDL ensures to search for error-indicating states/messages in_vt.vreplication_log
. If found, these are picked and used by Online DDL to determine that the migration is broken, and advertised forward in_vt.schema_migrations.message
.We furthermore prepend:
terminal error:
prefix for terminal errors in vreplication.vreplication:
prefix forschema_migrations
error messages originating byvreplication
.Related Issue(s)
Checklist
Deployment Notes